In DL_Thread.cpp :

public:

    bool __fastcall Send_String_DL_FIFO(unsigned int TimeValue, unsigned char Consist, byte * Command_String,
		unsigned char TIU, unsigned char Remote, int Expected, int WaitTime, bool Record_Flag, byte * ptrLashUpEngineList, int * ipFlag = NULL, int FlagValue = 0);
	bool __fastcall Send_Delayed_DL_FIFO(TOp * CallingOp, HWND Parent, DCommand Command,
		unsigned char ConsistNo, unsigned char TIU, unsigned char Remote, unsigned int TimeValue = 0, int iParameter = 0);
	bool __fastcall ClearDispatchList(void);
	int __fastcall Count_DL_FIFO(int option = 0);
	unsigned int __fastcall Count_Dispatch_List(int option = 0);



//---------------------------------------------------------------------------
// Send_String_DL_FIFO
// Runs in the context of the calling thread, not TDispatch_List_Thread
// "TimeValue" time value in milliseconds
// the item pointed to by ipFlag must be int or bool
//
// Note that Dispatch List will not work with commands that return data. Those commands must
// be sent directly by calling Send_String()
//
// Command_String goes into the Dispatch List and then we are done
//
// we never wait for a response event. Return true if Command_String was correctly inserted into the Dispatch List
//---------------------------------------------------------------------------

bool __fastcall TDispatch_List_Thread::Send_String_DL_FIFO(unsigned int TimeValue, unsigned char ConsistNo, byte * Command_String,
	unsigned char TIU, unsigned char Remote, int Expected, int WaitTime, bool Record_Flag, byte * ptrLashUpEngineList, int * ipFlag, int FlagValue)




//---------------------------------------------------------------------------
// Send_Delayed_DL_FIFO
// Runs in the context of the calling thread, not TDispatch_List_Thread
// "TimeValue" time value in milliseconds
//
// Note that Dispatch List will not work with commands that return data. Those commands must
// be sent directly by calling Send_String()
//
// DelayedCommand goes into the Dispatch List and then we are done
//
// we never wait for a response event. Return true if DelayedCommand was correctly inserted into the Dispatch List
//---------------------------------------------------------------------------
bool __fastcall TDispatch_List_Thread::Send_Delayed_DL_FIFO(TOp * CallingOp, HWND Parent, DCommand DelayedCommand,
		unsigned char ConsistNo, unsigned char TIU, unsigned char Remote, unsigned int TimeValue, int iParameter)






In Comm_Thread.cpp

private:
    bool __fastcall TIUSendWaitforResponseRetry(unsigned char ConsistNo, byte * Command,
		int ExpectedCount, int WaitTime, unsigned char Remote, unsigned char TIU, int * ptrRespCode,
    	int * SWResponseCount, byte * SWResponseBuffer);
    bool __fastcall Send_String(unsigned char Consist, byte * Command_String,
		unsigned char TIU, unsigned char Remote, int Expected, int WaitTime, bool Record_Flag, byte * ptrLashUpEngineList,
    	int * ptrRespCode, int * SSResponseCount, byte * SSResponseBuffer);

public:

    bool __fastcall Send_String_FIFO(unsigned char Consist, byte * Command_String,
		unsigned char TIU, unsigned char Remote, int Expected, int WaitTime, bool Record_Flag, byte * ptrLashUpEngineList = (byte *) NULL,
		int * ptrRespCode = (int *) NULL, int * SSResponseCount = (int *) NULL, byte * SSResponseBuffer = (byte *) NULL);

	bool __fastcall TIUSendWaitforResponse_FIFO(unsigned char Consist, byte * Command,
		int ExpectedCount, int WaitTime, unsigned char Remote, unsigned char TIU, int * ptrRespCode = (int *) NULL,
	    int * SWResponseCount = (int *) NULL, byte * SWResponseBuffer = (byte *) NULL);

    bool __fastcall SendHexStrStr_FIFO(int Port, String Cmd_In, int Len);
    bool __fastcall SendHexStr_FIFO(int Port, byte * Cmd_In, int Len);


//---------------------------------------------------------------------------
// Send_String is the general routine used to send a command to the TIU
//
// The complete command packet is constructed by this function (includes
// "5555" prefix, TIU, Remote, sequence number, CRC and "4D" EOT byte.
//
// Sends a command, waits for a response or an error indication, returns the
// response to the calling program if response pointers (ptrRespCode, SSResponseCount
// and SSResponseBuffer) are not NULL
//
// the complete command packet is constructed by this function.
//
// WaitTime is the time to wait for a response, in milliseconds.
// Expected is the number of bytes expected in the response from the TIU, includes
//     55554D prefix.
//
// calls TIUSendWaitforResponseRetry() which sends the cmmand packet, waits for
// a response and retries as necessary.
//
// Handles recording if Record_Flag is true.
//
// Turn Speed Mode off if the command asks for a return value from the TIU or
// performs a function which must wait for completion.
//
// Returns true on success, false on failure

bool __fastcall TCommThread::Send_String(unsigned char Consist, byte * Command_String,
	unsigned char TIU, unsigned char Remote, int Expected, int WaitTime, bool Record_Flag, byte * ptrLashUpEngineList,
    int * ptrRespCode, int * SSResponseCount, byte * SSResponseBuffer)



//---------------------------------------------------------------------------
// TIUSendWaitforResponseRetry 
//
// Sends a command, waits for a response or an error indication, returns the
// response to the calling program if response pointers (ptrRespCode, SWResponseCount
// and SWResponseBuffer) are not NULL
//
// Command is the complete command packet ready to be sent.
//
// Number of retries is set in the Setup window. Function checks response packet
// for correct format and ACK/NAK codes.
//
// WaitTime in milliseconds and must be less than 20,000 (20 seconds).
// 
// Returns true on success, false on failure



bool __fastcall TCommThread::TIUSendWaitforResponseRetry(unsigned char Consist, byte * Command,
	int ExpectedCount, int WaitTime, unsigned char Remote, unsigned char TIU, int * ptrRespCode,
    int * SWResponseCount, byte * SWResponseBuffer)
{
//
// Calls to Sleep() are ok in this thread
// NO VCL Calls in this thread
//
// Send Command string out TIU Port or the AIU Port and wait for a response of ExpectedCount bytes
// in WaitTime ms - NOTE: the ExpectedCount should include the 3 bytes of the "55554D" plus
// the number of bytes returned by the actual command. The TIU always responds with
// OKRESPONSE bytes when it receives the command, then more bytes up to MINRESPONSE bytes
// or more for some commands (ie 'x', '!', 'I', 'q', etc).
//
// Command is in binary and may contain 0x00.
//
// WaitTime in milliseconds and must be less than 20,000 (20 seconds).
//
// the encoded string received is decoded and placed into byteResp[]. Does not include the "55554D"
//
// This routine does NOT record. If needed, record must be performed before calling this routine.
//
// Return true on success, false on failure
//
// Examine value returned in *ptrRespCode for more details (see defines in Train_Control.h)
// ------




//---------------------------------------------------------------------------
// Send_String_FIFO()
// Enqueue the Command_String and associated data in the FIFO
// Wait for CommDoneEvent
// Runs in the context of the calling thread, not TCommThread
// Called by almost all UI windows, PC_Thread.cpp, DL_Thread.cpp and Engine_Status_Thread.cpp
// Typical usage: 
/* from TProg_Control_Thread::FetchByte()
bool bretv = ptrTIUCommThread->Send_String_FIFO(EngineNo, CommandString, TIUNo, MyRemoteNo, 21, QUERY_WAIT, NO_RECORD, NULL, NULL, NULL, FBResp);
if (!bretv) {	// retry once
	bretv = ptrTIUCommThread->Send_String_FIFO(EngineNo, CommandString, TIUNo, MyRemoteNo, 21, QUERY_WAIT, NO_RECORD, NULL, NULL, NULL, FBResp);
	if (!bretv) return false;	// return false with value == 0 if we can't read RAM
    }
*/
//
//---------------------------------------------------------------------------
bool __fastcall TCommThread::Send_String_FIFO(unsigned char Consist, byte * Command_String,
	unsigned char TIU, unsigned char Remote, int Expected, int WaitTime, bool Record_Flag, byte * ptrLashUpEngineList,
    int * ptrRespCode, int * SSResponseCount, byte * SSResponseBuffer)




//---------------------------------------------------------------------------
// SendHexStrStr_FIFO()
// FiFO version of SendHexStr() which uses a String as input
// Runs in the context of the calling thread, not TCommThread
// Called by Train_Control.cpp
//---------------------------------------------------------------------------

bool __fastcall TCommThread::SendHexStrStr_FIFO(int Port, String Cmd_In, int Len)  // Len is actual bytes to send



//---------------------------------------------------------------------------
// SendHexStr_FIFO()
// FIFO version of SendHexStr() which uses a binary hex string as input
// Runs in the context of the calling thread, not TCommThread
//---------------------------------------------------------------------------

bool __fastcall TCommThread::SendHexStr_FIFO(int Port, byte * Cmd_In, int Len)  // Len is actual bytes to send


